#pragma once
#include <thread>
#include <atomic>
#include "game.hpp"

enum Color_t
{
    Color_None,
    Color_Red,
    Color_Green,
    Color_Yellow,
    Color_Blue,
};

struct DisplayItem_t
{
    Color_t color{Color_None};
    char sign{' '};
};

Color_t GetPlayerColor(char c);

class Game;
class Displayer
{
private:
    // std::atomic_bool m_display_loop{true};
    // int64_t m_display_delta{100};
    // std::thread m_display_thread;
    Game &m_game;

    DisplayItem_t m_map[DISPLAY_BUFFER_SIZE];
    Displayer(void);

public:
    Displayer(Game &g);
    ~Displayer(void);

    void Update(void);
    // void UpdateThread(void);

private:
    int Location(int);
    void print(char c, Color_t color);
    void printstr(std::string s, Color_t color);
};
